package com.tgpms.web.cost.dao;

import com.tgpms.util.PageView;
import com.tgpms.web.cost.entity.EstimateHierarchyMaster;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 表ESTIMATE_HIERARCHY_MASTER -> D3105概算分级码 的基本功能实现
 *
 * @author May
 * @createDate 2019/08/12
 */
public interface EstimateHierarchyMasterMapper {
    /**
     * D3105概算分级码  deleteByPrimaryKey 实现
     *
     * @param estimateHierarchyCode
     * @return null int
     * @author: May
     * @createDate: 2019-08-12 15:05:56
     */
    int deleteByPrimaryKey(String estimateHierarchyCode);

    /**
     * D3105概算分级码  insert 实现
     *
     * @param record
     * @return null int
     * @author: May
     * @createDate: 2019-08-12 15:05:56
     */
    int insert(EstimateHierarchyMaster record);

    /**
     * D3105概算分级码  insertSelective 实现
     *
     * @param record
     * @return null int
     * @author: May
     * @createDate: 2019-08-12 15:05:56
     */
    int insertSelective(EstimateHierarchyMaster record);

    /**
     * D3105概算分级码  selectByPrimaryKey 实现
     *
     * @param estimateHierarchyCode
     * @return null com.tgpms.web.cost.entity.EstimateHierarchyMaster
     * @author: May
     * @createDate: 2019-08-12 15:05:56
     */
    EstimateHierarchyMaster selectByPrimaryKey(String estimateHierarchyCode);

    /**
     * D3105概算分级码  updateByPrimaryKeySelective 实现
     *
     * @param record
     * @return null int
     * @author: May
     * @createDate: 2019-08-12 15:05:56
     */
    int updateByPrimaryKeySelective(EstimateHierarchyMaster record);

    /**
     * D3105概算分级码  updateByPrimaryKey 实现
     *
     * @param record
     * @return null int
     * @author: May
     * @createDate: 2019-08-12 15:05:56
     */
    int updateByPrimaryKey(EstimateHierarchyMaster record);

    /**
     * D3105概算分级码
     * <p>
     * 根据层级码和父级概算层次代码查找
     *
     * @param levelNo
     * @param parentCode
     * @return
     */
    List<EstimateHierarchyMaster> findByLevelNoAndParentCode(@Param("levelNo") Short levelNo, @Param("parentCode") String parentCode);

    /**
     * 查询所有概算层次代码并做分页处理
     *
     * @param pageView
     * @return
     */
    List<EstimateHierarchyMaster> queryAll(@Param("pageView") PageView pageView);

    /**
     * 查询菜单
     *
     * @param estimateHierarchyCode 概算ID
     * @param levelNo 层次
     * @param parentCode 父级
     * @return null
     */
    List<Map<String, Object>> findKeyByMenu(@Param("estimateHierarchyCode") String estimateHierarchyCode,
                                            @Param("levelNo") Short levelNo,
                                            @Param("parentCode") String parentCode);
}